package com.xnyzc.lhy.mis.entity.common.penum;

public enum ECancelOrderType {

    replyBefore("0", "应答前乘客取消"),
    replyPassengersAfter("1", "应答后乘客取消"),
    replyDriverAfter("2", "应答后司机取消"),
    replyServiceAfter("3", "客服取消"),
    control("4", "⻛控取消"),
    other("5","其他取消");

    private String type;
    private String value;

    ECancelOrderType(String type, String value) {
        this.type = type;
        this.value = value;
    }

    public String getType() {
        return this.type;
    }

    public String getValue() {
        return this.value;
    }

    public static ECancelOrderType finaByType(String type) {
        ECancelOrderType eCallVehType;
        switch (type) {
            case "0":
                eCallVehType = ECancelOrderType.replyBefore;
                break;
            case "1":
                eCallVehType = ECancelOrderType.replyPassengersAfter;
                break;
            case "2":
                eCallVehType = ECancelOrderType.replyDriverAfter;
                break;
            case "3":
                eCallVehType = ECancelOrderType.replyServiceAfter;
                break;
            case "4":
                eCallVehType = ECancelOrderType.control;
                break;
            //做兼容问题
            case "应答前乘客取消":
                eCallVehType = ECancelOrderType.replyBefore;
                break;
            case "应答后乘客取消":
                eCallVehType = ECancelOrderType.replyPassengersAfter;
                break;
            case "应答后司机取消":
                eCallVehType = ECancelOrderType.replyDriverAfter;
                break;
            case "客服取消":
                eCallVehType = ECancelOrderType.replyServiceAfter;
                break;
            case "⻛控取消":
                eCallVehType = ECancelOrderType.control;
                break;
            default:
                eCallVehType = ECancelOrderType.other;
                break;
        }
        return eCallVehType;
    }
}
